package com.heima.model.common.threadlocal;

import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author Jt
 * @date 2021/4/14 11:02
 */
public class WmThreadLocalUtils {

    public final static ThreadLocal<WmUser> userThreadLocal = new ThreadLocal<>();

    /**
     * 设置当前线程中的用户
     * @param wmUser
     */
    public static void setUser (WmUser wmUser) {
        userThreadLocal.set(wmUser);
    }

    /**
     * 获取当前线程用户
     * @return
     */
    public static WmUser getUser () {
        return userThreadLocal.get();
    }

}
